﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DBMS.Indexes
{
    public class ComparableInteger : ComparableIndex<int>
    {
        private int value;

        public ComparableInteger(int value)
        {
            this.value = value;
        }

        public Object GetNativeValue()
        {
            return value;
        }

        public bool lessThanOrEqual(ComparableIndex<int> item)
        {
            int to = (int)item.GetNativeValue();
            return value <= to;
        }

        public bool lessThan(ComparableIndex<int> item)
        {
            int to = (int)item.GetNativeValue();
            return value < to;
        }
        public bool isEqualWith(ComparableIndex<int> item)
        {
            int to = (int)item.GetNativeValue();
            return value == to;
        }

        public bool greaterThan(ComparableIndex<int> item)
        {
            int to = (int)item.GetNativeValue();
            return value > to;
        }
        public bool greaterThanOrEqual(ComparableIndex<int> item)
        {
            int to = (int)item.GetNativeValue();
            return value >= to;
        }
    }
}